Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(*): Add cities list to make label #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aoudiamoncef
Copy link

@aoudiamoncef aoudiamoncef commented Mar 2, 2020

La PR permet de gérer le problème dans cette issue

CC @yohanboniface @cquest

@emanzat
Copy link

emanzat commented Mar 3, 2020

Hello @yohanboniface @cquest,

pensez-vous quoi de cette PR ?

D'avance merci,
Cdt,
Houcine.

Copy link
Member

@yohanboniface yohanboniface left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, désolé de me réveiller deux ans plus tard :(

label = '{} {}'.format(label, city)
add(labels, label)

result.labels.extend(sorted(list(labels), key=lambda item: (len(item), item), reverse=True))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ici je pense qu'on perd en efficacité: il faut trouver la bonne heuristique pour mettre en premier les labels les plus standards, ce qui était plus ou moins ce que le code essayait de faire.

if isinstance(raw_cities, list):
cities = raw_cities
else:
cities = [raw_cities]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faut sûrement checker plus loin dans la chaîne si le fait d'avoir une liste pour city est bien pris en charge, notamment pour le libellé final du résultat, et y compris les clients JS.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Nous avons ce code en production depuis 2 ans, j'avoue qu'il répond aux besoins mais la performance en soi, n'es pas très importante dans notre cas.

@aoudiamoncef
Copy link
Author

Hello @jdesboeufs

I'll be glad to continue the work on this PR.

I know that It works like a charm in production since 2022. We didn't see any performance issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants